﻿using System.Windows.Input;

using SportTraining.MVVM.View;

namespace SportTraining.MVVM.ViewModel.Impl
{
    public abstract class PageViewModel<T> : ViewModelBase<T>, IPageViewModel where T : PageViewModel<T>
    {
        protected IMainWindowViewModel mainWindowViewModel;

        protected PageViewModel(IMainWindowViewModel mainWindowViewModel)
        {
            this.mainWindowViewModel = mainWindowViewModel;

            OnError = new Command(param => mainWindowViewModel.CurrentPageUri = AppUri.ErrorPage);
        }

        #region Implementation of IPageViewModel
        public ICommand Back { get; set; }
        public ICommand Forward { get; set; }
        public ICommand OnError { get; set; }
        #endregion
    }
}